package com.hfkh.collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

public class Student {
	public static void main(String[] args) {
		List s = new ArrayList();
		s.add(5);
		s.add(2);
		s.add(1);
		s.add(4);

		Iterator it = s.iterator();
		while (it.hasNext()) {
			System.out.println(it.next());
			Collections.sort(s);

		}
		Collections.sort(s);
		for (int i = 0; i < s.size(); i++) {
			System.out.println(s.get(i));

		}

	}

}
